{% set pypi_name = 'nova' %}
{% set source = fetch_source('https://tarballs.openstack.org/nova/nova-master.tar.gz') %}
{% set upstream_version = upstream_version() %}
{% set rpm_release = '1' %}
%global with_doc 1
Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Epoch:          {{ epoch('nova') }}
Summary:        OpenStack Compute (nova)
License:        {{ license('Apache-2.0') }}
URL:            https://docs.openstack.org/nova
Source0:        {{ source|basename }}
Source1:        openstack-nova.defaultconf
Source3:        openstack-nova.logrotate
Source6:        openstack-nova-polkit.rules
Source7:        openstack-nova.sudoers
Source8:        unittests.blacklist
Source9:        openstack-nova.modules
Source10:       openstack-nova.modprobe
Source11:       openstack-nova-api.service
Source12:       openstack-nova-compute.service
Source14:       openstack-nova-scheduler.service
Source18:       openstack-nova-api-metadata.service
Source19:       openstack-nova-conductor.service
Source21:       openstack-nova-spicehtml5proxy.service
Source22:       openstack-nova-novncproxy.service
Source23:       openstack-nova-serialproxy.service
Source24:       openstack-nova-api-os-compute.service
Source27:       openstack-nova.tmpfiles
Source50:       openstack-nova.README.config
BuildRequires:  fdupes
BuildRequires:  openstack-macros
BuildRequires:  polkit
BuildRequires:  {{ py3('PyMySQL') }}
BuildRequires:  {{ py3('python-barbicanclient') }}
BuildRequires:  {{ py3('python-cinderclient') }}
BuildRequires:  {{ py3('cursive') }}
BuildRequires:  {{ py3('dataclasses') }}
BuildRequires:  {{ py3('ddt') }}
BuildRequires:  {{ py3('fixtures') }}
BuildRequires:  {{ py3('python-glanceclient') }}
BuildRequires:  {{ py3('python-ironicclient') }}
BuildRequires:  {{ py3('keystoneauth1') }}
BuildRequires:  {{ py3('python-keystoneclient') }}
BuildRequires:  {{ py3('keystonemiddleware') }}
BuildRequires:  {{ py3('microversion_parse') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('python-neutronclient') }}
BuildRequires:  {{ py3('python-novaclient') }}
BuildRequires:  {{ py3('os-api-ref') }}
BuildRequires:  {{ py3('os-brick') }}
BuildRequires:  {{ py3('os-resource-classes') }}
BuildRequires:  {{ py3('os-service-types') }}
BuildRequires:  {{ py3('os-traits') }}
BuildRequires:  {{ py3('os-vif') }}
BuildRequires:  {{ py3('os-win') }}
BuildRequires:  {{ py3('oslo.cache') }}
BuildRequires:  {{ py3('oslo.concurrency') }}
BuildRequires:  {{ py3('oslo.config') }}
BuildRequires:  {{ py3('oslo.context') }}
BuildRequires:  {{ py3('oslo.db') }}
BuildRequires:  {{ py3('oslo.i18n') }}
BuildRequires:  {{ py3('oslo.log') }}
BuildRequires:  {{ py3('oslo.messaging') }}
BuildRequires:  {{ py3('oslo.middleware') }}
BuildRequires:  {{ py3('oslo.policy') }}
BuildRequires:  {{ py3('oslo.privsep') }}
BuildRequires:  {{ py3('oslo.reports') }}
BuildRequires:  {{ py3('oslo.rootwrap') }}
BuildRequires:  {{ py3('oslo.serialization') }}
BuildRequires:  {{ py3('oslo.service') }}
BuildRequires:  {{ py3('oslo.upgradecheck') }}
BuildRequires:  {{ py3('oslo.utils') }}
BuildRequires:  {{ py3('oslo.versionedobjects') }}
BuildRequires:  {{ py3('oslo.vmware') }}
BuildRequires:  {{ py3('oslotest') }}
BuildRequires:  {{ py3('osprofiler') }}
BuildRequires:  {{ py3('paramiko') }}
BuildRequires:  {{ py3('psycopg2') }}
BuildRequires:  {{ py3('python-subunit') }}
BuildRequires:  {{ py3('requests-mock') }}
BuildRequires:  {{ py3('retrying') }}
BuildRequires:  {{ py3('testrepository') }}
BuildRequires:  {{ py3('testresources') }}
BuildRequires:  {{ py3('testscenarios') }}
BuildRequires:  {{ py3('testtools') }}
BuildRequires:  {{ py3('tooz') }}
BuildRequires:  {{ py3('websockify') }}
BuildRequires:  {{ py3('wsgi_intercept') }}
BuildRequires:  sudo
Requires:       logrotate
Requires:       python3-{{ pypi_name }} = %{epoch}:%{version}-%{release}
BuildArch:      noarch
%if 0%{?suse_version}
BuildRequires:  systemd-rpm-macros
Requires(pre):  pwdutils
%{?systemd_requires}
%else
BuildRequires:  systemd
Requires(post): systemd
Requires(postun): systemd
Requires(pre):  shadow-utils
Requires(preun): systemd
%endif

%description
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform. It gives you the
software, control panels, and APIs required to orchestrate a cloud,
including running instances, managing networks, and controlling access
through users and projects. OpenStack Compute strives to be both
hardware and hypervisor agnostic, currently supporting a variety of
standard hardware configurations and seven major hypervisors.

%package -n python3-{{ pypi_name }}
Summary:        Nova Python library
Group:          Applications/System
# Require openssh for ssh-keygen
Requires:       openssh
Requires:       openssl
Requires:       {{ py3('Babel') }}
Requires:       {{ py3('Jinja2') }}
Requires:       {{ py3('Paste') }}
Requires:       {{ py3('PasteDeploy') }}
Requires:       {{ py3('PrettyTable') }}
Requires:       {{ py3('Routes') }}
Requires:       {{ py3('SQLAlchemy') }}
Requires:       {{ py3('WebOb') }}
Requires:       {{ py3('castellan') }}
Requires:       {{ py3('python-cinderclient') }}
Requires:       {{ py3('cryptography') }}
Requires:       {{ py3('cursive') }}
Requires:       {{ py3('dataclasses') }}
Requires:       {{ py3('decorator') }}
Requires:       {{ py3('eventlet') }}
Requires:       {{ py3('python-glanceclient') }}
Requires:       {{ py3('greenlet') }}
Requires:       {{ py3('iso8601') }}
Requires:       {{ py3('jsonschema') }}
Requires:       {{ py3('keystoneauth1') }}
Requires:       {{ py3('keystonemiddleware') }}
Requires:       {{ py3('lxml') }}
Requires:       {{ py3('microversion_parse') }}
Requires:       {{ py3('netaddr') }}
Requires:       {{ py3('netifaces') }}
Requires:       {{ py3('python-neutronclient') }}
Requires:       {{ py3('os-brick') }}
Requires:       {{ py3('os-resource-classes') }}
Requires:       {{ py3('os-service-types') }}
Requires:       {{ py3('os-vif') }}
Requires:       {{ py3('os-win') }}
Requires:       {{ py3('oslo.cache') }}
Requires:       {{ py3('oslo.concurrency') }}
Requires:       {{ py3('oslo.config') }}
Requires:       {{ py3('oslo.context') }}
Requires:       {{ py3('oslo.db') }}
Requires:       {{ py3('oslo.i18n') }}
Requires:       {{ py3('oslo.log') }}
Requires:       {{ py3('oslo.messaging') }}
Requires:       {{ py3('oslo.middleware') }}
Requires:       {{ py3('oslo.policy') }}
Requires:       {{ py3('oslo.privsep') }}
Requires:       {{ py3('oslo.reports') }}
Requires:       {{ py3('oslo.rootwrap') }}
Requires:       {{ py3('oslo.serialization') }}
Requires:       {{ py3('oslo.service') }}
Requires:       {{ py3('oslo.utils') }}
Requires:       {{ py3('oslo.versionedobjects') }}
Requires:       {{ py3('paramiko') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('psutil') }}
Requires:       {{ py3('requests') }}
Requires:       {{ py3('retrying') }}
Requires:       {{ py3('rfc3986') }}
Requires:       {{ py3('six') }}
Requires:       {{ py3('sqlalchemy-migrate') }}
Requires:       {{ py3('stevedore') }}
Requires:       {{ py3('tooz') }}
Requires:       {{ py3('websockify') }}
Requires:       sudo

%description -n python3-{{ pypi_name }}
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform.

This package contains the nova Python library.

%package api
Summary:        OpenStack Nova - API service
Group:          Applications/System
Requires:       %{name} = %{epoch}:%{version}-%{release}

%description api
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform. It gives you the
software, control panels, and APIs required to orchestrate a cloud,
including running instances, managing networks, and controlling access
through users and projects. OpenStack Compute strives to be both
hardware and hypervisor agnostic, currently supporting a variety of
standard hardware configurations and seven major hypervisors.

This package contains the Nova services providing programmatic access.

%package compute
Summary:        OpenStack Nova Virtual Machine control service
Group:          Applications/System
Requires:       %{name} = %{epoch}:%{version}-%{release}
Requires:       bridge-utils
Requires:       curl
Requires:       ipmitool
Requires:       iptables
Requires:       lvm2
Requires:       {{ py3('python-ironicclient') }}
Requires:       {{ py3('libguestfs') }}
Requires:       {{ py3('libvirt-python') }}
Requires:       rsync
%if 0%{?suse_version} && 0%{?sle_version} >= 150000
Requires:       mkisofs
%else
Requires:       genisoimage
%endif
%if 0%{?suse_version}
Requires:       dosfstools
Requires:       open-iscsi
Requires:       openssh
Requires:       tunctl
%else
Requires:       iscsi-initiator-utils
Requires:       openssh-clients
%endif

%description compute
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform. It gives you the
software, control panels, and APIs required to orchestrate a cloud,
including running instances, managing networks, and controlling access
through users and projects. OpenStack Compute strives to be both
hardware and hypervisor agnostic, currently supporting a variety of
standard hardware configurations and seven major hypervisors.

This package contains the Nova service for controlling Virtual Machines.

%package conductor
Summary:        OpenStack Nova Conductor services
Group:          Applications/System
Requires:       %{name} = %{epoch}:%{version}-%{release}

%description conductor
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform. It gives you the
software, control panels, and APIs required to orchestrate a cloud,
including running instances, managing networks, and controlling access
through users and projects. OpenStack Compute strives to be both
hardware and hypervisor agnostic, currently supporting a variety of
standard hardware configurations and seven major hypervisors.

This package contains the Nova services providing database access for
the compute service

%package novncproxy
Summary:        OpenStack Nova noVNC proxy service
Group:          Applications/System
Requires:       %{name} = %{epoch}:%{version}-%{release}
Requires:       novnc

%description novncproxy
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform. It gives you the
software, control panels, and APIs required to orchestrate a cloud,
including running instances, managing networks, and controlling access
through users and projects. OpenStack Compute strives to be both
hardware and hypervisor agnostic, currently supporting a variety of
standard hardware configurations and seven major hypervisors.

This package contains the Nova noVNC Proxy service that can proxy
VNC traffic over browser websockets connections.

%package scheduler
Summary:        OpenStack Nova VM distribution service
Group:          Applications/System
Requires:       %{name} = %{epoch}:%{version}-%{release}

%description scheduler
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform. It gives you the
software, control panels, and APIs required to orchestrate a cloud,
including running instances, managing networks, and controlling access
through users and projects. OpenStack Compute strives to be both
hardware and hypervisor agnostic, currently supporting a variety of
standard hardware configurations and seven major hypervisors.

This package contains the service for scheduling where
to run Virtual Machines in the cloud.

%package serialproxy
Summary:        OpenStack Nova serial console access service
Group:          Applications/System
Requires:       %{name} = %{epoch}:%{version}-%{release}
Requires:       novnc

%description serialproxy
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform. It gives you the
software, control panels, and APIs required to orchestrate a cloud,
including running instances, managing networks, and controlling access
through users and projects. OpenStack Compute strives to be both
hardware and hypervisor agnostic, currently supporting a variety of
standard hardware configurations and seven major hypervisors.

This package contains the Nova services providing the
serial console access service to Virtual Machines.

%package spicehtml5proxy
Summary:        OpenStack Nova - Spice HTML5 console access service
Group:          Applications/System
Requires:       %{name} = %{epoch}:%{version}-%{release}

%description spicehtml5proxy
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform. It gives you the
software, control panels, and APIs required to orchestrate a cloud,
including running instances, managing networks, and controlling access
through users and projects. OpenStack Compute strives to be both
hardware and hypervisor agnostic, currently supporting a variety of
standard hardware configurations and seven major hypervisors.

This package contains the Nova services providing the
spice HTML5 console access service to Virtual Machines.

%if 0%{?with_doc}
%package doc
Summary:        Documentation for OpenStack Compute
Group:          Documentation/HTML
BuildRequires:  graphviz
BuildRequires:  {{ py3('Sphinx') }}
BuildRequires:  {{ py3('openstackdocstheme') }}
BuildRequires:  {{ py3('sphinx-feature-classification') }}
BuildRequires:  {{ py3('sphinxcontrib-actdiag') }}
BuildRequires:  {{ py3('sphinxcontrib-seqdiag') }}
BuildRequires:  {{ py3('sphinxcontrib-svg2pdfconverter') }}

%description doc
OpenStack Compute (codename Nova) is open source software designed to
provision and manage large networks of virtual machines, creating a
redundant and scalable cloud computing platform.

This package contains documentation files for nova.
%endif

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup
find . \( -name .gitignore -o -name .placeholder \) -delete
find nova -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +

%build
%{py3_build}
%if 0%{?with_doc}
export PBR_VERSION={{ upstream_version }} PYTHONPATH=$PWD
%sphinx_build -b html doc/source doc/build/html
%sphinx_build -b man doc/source doc/build/man
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
rm -rf doc/build/man/.{doctrees,buildinfo}
%fdupes doc/build/html/
%fdupes doc/build/man/
%endif
# config file generation
PYTHONPATH=. oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
PYTHONPATH=. oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf

%install
%{py3_install}

%if 0%{?with_doc}
# man pages
mkdir -p %{buildroot}%{_mandir}/man1
install -p -D -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1/
%endif

# Setup directories
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova/instances
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova/keys
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova/tmp
install -d -m 750 %{buildroot}%{_localstatedir}/log/nova
install -d -m 700 %{buildroot}%{_rundir}/nova
install -d -m 700 %{buildroot}%{_localstatedir}/cache/nova

# systemd tmpfiles
install -D -m 644 %{SOURCE27} %{buildroot}/%_tmpfilesdir/%name.conf

# Install config files
install -d -m 755 %{buildroot}%{_sysconfdir}/nova
install -d -m 755 %{buildroot}%{_sysconfdir}/nova/nova.conf.d
install -p -D -m 640 %{SOURCE50} %{buildroot}%{_sysconfdir}/nova/README.config
install -p -D -m 640 %{SOURCE1} %{buildroot}%{_sysconfdir}/nova/nova.conf.d/010-nova.conf
install -p -D -m 640 etc/nova/api-paste.ini %{buildroot}%{_sysconfdir}/nova/api-paste.ini
install -p -D -m 640 etc/nova/logging_sample.conf %{buildroot}%{_sysconfdir}/nova/logging.conf
install -p -D -m 640 etc/nova/nova.conf.sample  %{buildroot}%{_sysconfdir}/nova/nova.conf
install -p -D -m 640 etc/nova/policy.yaml.sample %{buildroot}%{_sysconfdir}/nova/policy.yaml
install -p -D -m 640 etc/nova/rootwrap.conf %{buildroot}%{_sysconfdir}/nova/rootwrap.conf

# delete installed conf files in usr/etc
rm -rf %{buildroot}%{_prefix}%{_sysconfdir}/

# Install version info file
cat > %{buildroot}%{_sysconfdir}/nova/release <<EOF
[Nova]
vendor = %{distribution}
product = OpenStack Nova
package = %{version}-%{release}
EOF

# install logrotate
install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

# install completion
install -p -D -m 644 tools/nova-manage.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/openstack-nova-manage.sh

# install polkit
install -D -m 644 %{SOURCE6} %{buildroot}%{_datadir}/polkit-1/rules.d/10-openstack-nova-compute.rules

# install modules/modprobe
install -D -m 644 %{SOURCE9} %{buildroot}%{_libexecdir}/modules-load.d/openstack-nova-compute.conf
install -D -m 644 %{SOURCE10} %{buildroot}%{_sysconfdir}/modprobe.d/openstack-nova-compute

# install sudoers
install -p -D -m 440 %{SOURCE7} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}

# install systemd service files
install -p -D -m 755 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}-api.service
install -p -D -m 755 %{SOURCE12} %{buildroot}%{_unitdir}/%{name}-compute.service
install -p -D -m 755 %{SOURCE14} %{buildroot}%{_unitdir}/%{name}-scheduler.service
install -p -D -m 755 %{SOURCE18} %{buildroot}%{_unitdir}/%{name}-api-metadata.service
install -p -D -m 755 %{SOURCE19} %{buildroot}%{_unitdir}/%{name}-conductor.service
install -p -D -m 755 %{SOURCE21} %{buildroot}%{_unitdir}/%{name}-spicehtml5proxy.service
install -p -D -m 755 %{SOURCE22} %{buildroot}%{_unitdir}/%{name}-novncproxy.service
install -p -D -m 755 %{SOURCE23} %{buildroot}%{_unitdir}/%{name}-serialproxy.service
install -p -D -m 755 %{SOURCE24} %{buildroot}%{_unitdir}/%{name}-api-os-compute.service

# install symlinks on SUSE
%if 0%{?suse_version}
mkdir -p %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-api
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-compute
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-scheduler
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-api-metadata
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-conductor
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-spicehtml5proxy
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-novncproxy
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-serialproxy
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-api-os-compute
%endif

cp -a etc/nova/rootwrap.d/ %{buildroot}%{_sysconfdir}/nova/
%fdupes %{buildroot}/%{python3_sitelib}

%check
# drop some tests we don't want to run currently
rm -r nova/tests/unit/virt/zvm
rm -r nova/tests/unit/virt/powervm
rm nova/tests/unit/test_hacking.py
%{__python3} -m stestr.cli --test-path nova/tests/unit run

%pre
# need a fixed uid/gid for being able to use shared storage over NFS
%if 0%{?suse_version}
%openstack_pre_user_group_create -u 96 -g 96 -s /bin/bash nova nova
%else
%openstack_pre_user_group_create -u 162 -g 162 -s /bin/bash nova nova
%endif

%post
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf

#POST actions
%post api
%systemd_post %{name}-api.service %{name}-api-metadata.service %{name}-api-os-compute.service

%post compute
%systemd_post %{name}-compute.service

%post conductor
%systemd_post %{name}-conductor.service

%post novncproxy
%systemd_post %{name}-novncproxy.service

%post scheduler
%systemd_post %{name}-scheduler.service

%post serialproxy
%systemd_post %{name}-serialproxy.service

%post spicehtml5proxy
%systemd_post %{name}-spicehtml5proxy.service

#PREUN actions
%preun api
%systemd_preun %{name}-api.service %{name}-api-metadata.service %{name}-api-os-compute.service


%preun compute
%systemd_preun %{name}-compute.service

%preun conductor
%systemd_preun %{name}-conductor.service

%preun novncproxy
%systemd_preun %{name}-novncproxy.service

%preun scheduler
%systemd_preun %{name}-scheduler.service

%preun spicehtml5proxy
%systemd_preun %{name}-spicehtml5proxy.service

%preun serialproxy
%systemd_preun %{name}-serialproxy.service

#POSTUN actions
%postun api
%systemd_postun_with_restart %{name}-api.service %{name}-api-metadata.service %{name}-api-os-compute.service

%postun compute
%systemd_postun_with_restart %{name}-compute.service

%postun conductor
%systemd_postun_with_restart %{name}-conductor.service

%postun novncproxy
%systemd_postun_with_restart %{name}-novncproxy.service

%postun scheduler
%systemd_postun_with_restart %{name}-scheduler.service

%postun spicehtml5proxy
%systemd_postun_with_restart %{name}-spicehtml5proxy.service

%postun serialproxy
%systemd_postun_with_restart %{name}-serialproxy.service

%files
%license LICENSE
%doc README.rst
%dir %{_sysconfdir}/nova
%dir %{_sysconfdir}/nova/rootwrap.d
%dir %attr(-, nova, nova) %{_localstatedir}/lib/nova
%dir %attr(-, nova, nova) %{_localstatedir}/lib/nova/instances
%dir %attr(-, nova, nova) %{_localstatedir}/lib/nova/keys
%dir %attr(-, nova, nova) %{_localstatedir}/lib/nova/tmp
%dir %attr(-, nova, root) %{_localstatedir}/log/nova
%dir %attr(-, nova, nova) %{_localstatedir}/cache/nova
%{_sysconfdir}/bash_completion.d/openstack-nova-manage.sh
%{_sysconfdir}/nova/release
%_tmpfilesdir/%name.conf
%dir %{_sysconfdir}/nova/nova.conf.d/
%{_sysconfdir}/nova/README.config
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/sudoers.d/%{name}
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/api-paste.ini
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/logging.conf
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/nova.conf
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/policy.yaml
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/rootwrap.conf
%config(noreplace) %attr(0640, root, nova) %{_sysconfdir}/nova/nova.conf.d/010-nova.conf
%{_bindir}/nova-manage
%{_bindir}/nova-policy
%{_bindir}/nova-rootwrap
%{_bindir}/nova-rootwrap-daemon
%{_bindir}/nova-status
%if 0%{?with_doc}
%{_mandir}/man1/nova-rootwrap.1.gz
%{_mandir}/man1/nova-manage.1.gz
%{_mandir}/man1/nova-status.1.gz
%endif

%files -n python3-nova
%license LICENSE
%{python3_sitelib}/nova/
%{python3_sitelib}/nova-*.egg-info

%files api
%license LICENSE
%{_bindir}/nova-api-wsgi
%{_bindir}/nova-metadata-wsgi
%{_bindir}/nova-api
%{_bindir}/nova-api-metadata
%{_bindir}/nova-api-os-compute
%{_unitdir}/%{name}-api.service
%{_unitdir}/%{name}-api-metadata.service
%{_unitdir}/%{name}-api-os-compute.service
%if 0%{?suse_version}
%{_sbindir}/rc%{name}-api-metadata
%{_sbindir}/rc%{name}-api
%{_sbindir}/rc%{name}-api-os-compute
%endif
%if 0%{?with_doc}
%{_mandir}/man1/nova-api.1.gz
%{_mandir}/man1/nova-api-os-compute.1.gz
%{_mandir}/man1/nova-api-metadata.1.gz
%endif

%files compute
%license LICENSE
%{_bindir}/nova-compute
%config %{_sysconfdir}/nova/rootwrap.d/compute.filters
%{_datadir}/polkit-1/rules.d/10-openstack-nova-compute.rules
%{_libexecdir}/modules-load.d/openstack-nova-compute.conf
%{_sysconfdir}/modprobe.d/openstack-nova-compute
%{_unitdir}/%{name}-compute.service
%if 0%{?suse_version}
%{_sbindir}/rc%{name}-compute
%endif
%if 0%{?with_doc}
%{_mandir}/man1/nova-compute.1.gz
%endif

%files conductor
%license LICENSE
%{_bindir}/nova-conductor
%{_unitdir}/%{name}-conductor.service
%if 0%{?suse_version}
%{_sbindir}/rc%{name}-conductor
%endif
%if 0%{?with_doc}
%{_mandir}/man1/nova-conductor.1.gz
%endif

%files novncproxy
%license LICENSE
%{_bindir}/nova-novncproxy
%{_unitdir}/%{name}-novncproxy.service
%if 0%{?suse_version}
%{_sbindir}/rc%{name}-novncproxy
%endif
%if 0%{?with_doc}
%{_mandir}/man1/nova-novncproxy.1.gz
%endif

%files scheduler
%license LICENSE
%{_bindir}/nova-scheduler
%{_unitdir}/%{name}-scheduler.service
%if 0%{?suse_version}
%{_sbindir}/rc%{name}-scheduler
%endif
%if 0%{?with_doc}
%{_mandir}/man1/nova-scheduler.1.gz
%endif

%files spicehtml5proxy
%license LICENSE
%{_bindir}/nova-spicehtml5proxy
%{_unitdir}/%{name}-spicehtml5proxy.service
%if 0%{?suse_version}
%{_sbindir}/rc%{name}-spicehtml5proxy
%endif
%if 0%{?with_doc}
%{_mandir}/man1/nova-spicehtml5proxy.1.gz
%endif

%files serialproxy
%license LICENSE
%{_bindir}/nova-serialproxy
%{_unitdir}/%{name}-serialproxy.service
%if 0%{?suse_version}
%{_sbindir}/rc%{name}-serialproxy
%endif
%if 0%{?with_doc}
%{_mandir}/man1/nova-serialproxy.1.gz
%endif

%if 0%{?with_doc}
%files doc
%license LICENSE
%doc doc/build/html
%endif

%changelog
